package com.leha.mp.api.controller;

import com.leha.mp.core.services.BalanceServices;
import com.leha.mp.core.services.BedgeServices;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import utils.APIResult;

@RestController
@Api(value = "/wallet", description = "钱包账单类API")
@RequestMapping("/wallet")
@ResponseStatus(HttpStatus.OK)
public class WalletController {
    @Autowired
    BalanceServices balanceServices;

    @GetMapping("/doctor/{doctorId}")
    @ApiOperation("获取账户信息_医生端")
    public APIResult getDoctorBalance(@PathVariable Integer doctorId) {
        return new APIResult(balanceServices.GetDoctorIncome(doctorId));
    }

    @GetMapping("/doctor/billList")
    @ApiOperation("获取账单详情_医生端")
    public APIResult getDoctorBill(Integer doctorId, String beginDate, String endDate) {
        return new APIResult(balanceServices.GetDoctorBillList(doctorId, beginDate, endDate));
    }

    @GetMapping("/doctor/incomeStatics")
    @ApiOperation("获取账单统计_医生端")
    public APIResult getDoctorBillStatics(Integer doctorId, String beginDate, String endDate) {
        return new APIResult(balanceServices.GetDoctorIncomdeStatics(doctorId, beginDate, endDate));
    }
}
